package com.test.demo.controller;

import com.test.demo.entity.Book;
import com.test.demo.repository.BookRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: liangruichao
 * @date: 2022-08-26 16:55
 **/
@RestController
@CrossOrigin
@RequestMapping("/bookinfo")
public class BookInfo {
    @Autowired
    BookRepository bookRepository;

    @GetMapping("/findAll")
    public List<Book> findAll(){
         return bookRepository.findAll();
    }



}
